#include <stdexcept>

#include "ncmcrypt.h"

int main(int argc, char* argv[])
{
    if (argc <= 1)
    {
        std::cout << "please input file path!" << std::endl;
        return 1;
    }

    try
    {
        for (int i = 1; i < argc; i++)
        {
            NeteaseCrypt crypt(argv[i]);
            crypt.Dump();
            crypt.FixMetadata();

            std::cout << crypt.DumpFilePath() << std::endl;
        }
    }
    catch (std::invalid_argument e)
    {
        std::cout << "exception: " << e.what() << std::endl;
    }
    catch (...)
    {
        std::cout << "other exceptions." << std::endl;
    }
    return 0;
}
